#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
  long long num=5273545,num1;
  int sum=0;
  for(long long i = 3;i <= num;i+=2){
    num1=i;
    while(num1%3==0||num1%5==0||num1%7==0){
      if(num1%3==0) num1/=3;
      if(num1%5==0) num1/=5;
      if(num1%7==0) num1/=7;
    }
    if(num1==1) sum++;
  }
  printf("%d",sum);
  return 0;
}
